// Raf Lempens & Bjorn Schobben
#include "QtPusher.h"
#include "QtPusherActivateAnimation.h"

QtPusher::QtPusher(unsigned int initialCellX, unsigned int initialCellY): Pusher(initialCellX, initialCellY), animationLog(0)
{
	pusherSprite = new QtPusherSprite();
}

QtPusher::~QtPusher()
{
	if (pusherSprite)
	{
		delete pusherSprite;
		pusherSprite = 0;
	}
}

void QtPusher::SetAnimationLog(QtAnimationLog* log)
{
	animationLog = log;
}

void QtPusher::Activate()
{
	if (animationLog)
	{
		QtPusherActivateAnimation command;

		command.SetPusher(pusherSprite);

		animationLog->AddAnimationCommand(&command);
	}
}

QtPusherSprite* QtPusher::GetSprite() const
{
	return pusherSprite;
}



